package com.yami.shop.bean.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;
@Getter
@AllArgsConstructor
public enum UserFundDetailEnum {
    PM_0("0","减"),
    PM_1("1","加"),

    /**
     * 树形数据,指定某种类型的金额下有几种操作类型
     */

    /**
     * b_owner 的用户类型的资金分类和操作
     */
    DISTRIBUTION_BONUS("distribution_bonus","分销奖励"),
    TYPE_0("level1","一级分销奖金"),//三级分销功能
    TYPE_1("level2","二级分销奖金"),//三级分销功能
    TYPE_2("level3","三级分销奖金"),//三级分销功能
    TYPE_3("cashOutDeduction","提现扣除"),
    TYPE_4("cashOutReturn","提现驳回(退回)"),
    TYPE_5("reward2YuanMoney","升级用户下单对老上级的奖励"),//三级分销功能
    TYPE_6("recommendFirstOrder","推荐新用户首次下单奖"),//一级分销功能
    TYPE_7("memberRepeatOrder","会员重复下单奖"),//一级分销功能
    TYPE_8("teamLeaderReward","团长奖励"),//一级分销功能
    TYPE_9("dayBonus","每天分红"),//一级分销功能
    TYPE_10("placeAnOrderDeduction","下单抵扣"),//下单抵扣
    TYPE_11("placeAnOrderReturn","抵扣金额退回"),//下单后退款,抵扣金额退回
    ;


    private String value;
    private String desc;

    public static UserFundDetailEnum toType(String value) {
        return Stream.of(UserFundDetailEnum.values())
                .filter(p -> p.value == value)
                .findAny()
                .orElse(null);
    }
}
